notes intro/old submit AP Problems the dump links
 

Password search

 

Start with this zip.

Uncomment and then write the following methods

 

  • public boolean findSalary(int salary) that will return true if salary is located or false if is not there
  • public boolean findSalary(int[] salariesToCheck) that will check to see if any salariestocheck are in there

Uncomment to sort the array using the static method.

 

After you sort:

Uncomment and then write the following methods

  • fastFind
  • fastFind(int[] salariesToCheck)

 


 

Now the passwords, here are the lists. Write these methods:

 

  • binarySearch(String password) that will return the location of the first time password is used
  • public int findHowMany (String yourPassword) that will return how many of the list are yourPassword (use binarySearch above)
  • public String[] findTop(int howMany) this will return an array of the all passwords that have been used howMany times
  • public void findAllDerivatives(String word) that will print all the passwords that contain word and how many of each there are. (use indexOf)So if they put hello; it might say helloDude - 4,hihello-3 and so on.

High flyers:

  • boolean isHackResistant(String yourPassword) that checks to make sure the password is atleast 6 characters long with at least 1 number and letter in it.
  • boolean isHackProof (String yourPassword) that checks to make sure the password is atleast 6 characters long with at least 1 number and it has been used less than 3 times out of 200000)